@import "variables";
@import "mixins";

// Add a chevron (>) after the link text for a11y
main a::after {
  content: " \203A";
}

// Hide chevron in buttons
main a.button::after,
a.section-link::after {
  content: "";
}

/* Homepage Hero */
.hero {
  background-color: $ocean;
  color: $white;

  .text-block {
    max-width: 65%;
    padding: 0 0 0.5em;

    p {
      color: $white;
      font-size: 19px;
      font-weight: bold;
    }

    h1 {
      font-size: 36px;
    }

    h2 {
      font-size: 36px;
    }
  }

  &.homepage {
    padding-bottom: 5em; // same as .grid-container margin-top
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
  }

  @include breakpoint(small) {
    .text-block {
      max-width: unset;
      margin-right: 0;
    }

    .button {
      display: block;
      text-align: center;
    }

    &.homepage {
      background-image: none;
    }
  }
}

.grid-container {
  margin-top: -5em;

  .grid.three {
    padding-bottom: 1em;

    .card {
      position: relative;
      padding: 1.5em 1em;
      background-color: $white;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
      text-align: center;

      h3 {
        color: $darkgrey;
        font-size: 22px;
      }

      p {
        color: $darkgrey;
      }
    }
  }
}

.introduction {
  .grid.two {
    padding: 2em;

    p {
      margin: 0;
      font-size: 16px;

      &.strong {
        color: $darkgrey;
      }
    }
  }

  @include breakpoint(small) {
    padding: 0 1em;
  }
}

.use-cases {
  .grid {
    margin-bottom: 1em;
    grid-template-areas: "image text";
    grid-template-columns: 20% 1fr;

    .image {
      display: flex;
      align-items: center;
      justify-content: center;
      background-color: $ocean;
      grid-area: image;
      text-align: center;

      img {
        justify-self: center;
      }
    }

    &.image-right {
      grid-template-areas: "text image";
      grid-template-columns: 1fr 20%;

      @include breakpoint(small) {
        grid-template-areas:
          "image"
          "text";
        grid-template-columns: 1fr;
      }
    }

    .text {
      padding: 1em;
      border: 1px solid $lightgrey;
      grid-area: text;
    }

    @include breakpoint(small) {
      grid-template-areas:
        "image"
        "text";
      grid-template-columns: 1fr;
      grid-template-rows: minmax(160px, 1fr);
    }
  }

  h2 {
    color: $black;
  }

  p.strong {
    color: $darkgrey;
    font-size: 16px;
  }
}

.team {
  background-color: $indigo;

  h2,
  h3,
  p {
    color: $white;
  }

  p {
    font-size: 16px;
  }

  a {
    color: $white;
    font-weight: 300;
  }

  .grid.three {
    margin: 1em 0;
    row-gap: 1.5em;
  }

  .bio {
    display: grid;
    column-gap: 1em;
    grid-template-columns: 7em 1fr;

    .image img {
      width: 7em;
      height: 7em;
    }

    .info {
      align-self: center;

      p {
        margin: 0;

        &.name {
          font-family: $metropolis-medium;
          font-size: 16px;
        }

        &.position {
          font-size: 14px;
        }
      }
    }
  }
}

.hero.subpage-hero {
  padding-bottom: 90px;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;

  h1 {
    font-size: 46px;
    text-align: center;

    @include breakpoint(small) {
      font-size: 26px;
    }
  }
}

.hero.homepage {
  background-blend-mode: hard-light;
  background-image: url("/img/background.png");
  background-position: center right;
  background-repeat: no-repeat;
  background-size: 65%;
}

.experimental {
  .grid.three .col {
    padding: 0;
  }

  .icon {
    display: flex;
    min-height: 95px;
    align-items: center;
    justify-content: center;
    padding: 25px;
    background-color: $ocean;
  }

  .content {
    padding: 25px;

    .example {
      background-color: $lightgrey;
    }
  }
}

.blog {
  padding-bottom: 50px;

  .col {
    border: 1px solid $lightgrey;

    img {
      width: 100%;
    }

    .content {
      padding: 0 20px;
    }
  }

  &.landing {
    margin-top: -90px;
    background-color: #fff;

    h3 a {
      font-size: 16px;
    }

    .pagination {
      margin: 30px auto 50px;

      ul {
        padding: 0;
        text-align: center;

        li {
          padding: 0;

          a {
            padding: 5px 10px;

            &.active {
              border-radius: 50%;
              background-color: $lightgrey;
            }
          }

          &.left-arrow {
            margin-right: 15px;
          }

          &.right-arrow {
            margin-left: 15px;
          }
        }
      }
    }
  }

  .blog-post {
    padding: 30px 90px 30px 30px;
    margin: -110px 0 0 -30px;
    background-color: #fff;

    .author {
      margin: 0;
      color: $indigo;
    }

    .date {
      margin: 0;
      color: $black;
      font-weight: 600;
    }

    .header,
    h4 {
      color: $black;
      font-weight: 600;
    }

    a {
      font-size: 16px;
    }

    ul {
      padding-left: 20px;
      list-style-type: disc;

      li {
        display: list-item;
        margin-bottom: 10px;
        color: $darkgrey;
        font-size: 14px;
        line-height: 1.6em;
        list-style-image: url(/img/arrow.svg);
        list-style-type: unset;

        &:first-child {
          margin-top: 10px;
        }
      }
    }

    ol {
      li {
        display: list-item;
        margin-bottom: 10px;
        color: $darkgrey;
        font-size: 16px;
        list-style-type: decimal;

        &:first-child {
          margin-top: 10px;
        }
      }
    }

    code {
      padding: 2px 8px;
      border: 2px solid $lightgrey;
      color: $darkgrey;
    }

    pre {
      code {
        display: block;
        padding: 15px;
        border: 15px solid $lightgrey;
        margin-bottom: 30px;
        overflow-x: auto;
      }
    }

    img {
      max-width: 100%;
    }

    strong {
      font-family: $metropolis-medium;
    }
  }
}

.getting-started {
  background-color: $lightgrey;
  color: $black;

  p {
    color: $black;
    font-size: 16px;
  }

  .left-side {
    width: 50%;
    float: left;
  }

  .right-side {
    width: 25%;
    float: right;
  }

  h2 {
    margin-bottom: 0;
    font-size: 30px;
  }

  a {
    display: block;
    min-width: unset;
    max-width: 138px;
    padding: 10px;
    text-align: center;
  }

  .button {
    border: 1px solid $indigo;
    margin-top: 50px;
  }

  @include breakpoint(small) {
    .wrapper {
      padding-bottom: 40px;
    }

    .left-side {
      width: 100%;
      float: none;
    }

    .right-side {
      width: 100%;
      float: none;
    }

    .button {
      display: block;
      max-width: unset;
      margin-top: 20px;
      text-align: center;
    }
  }
}

.subpage {
  padding: 30px 30px 50px;
  margin-top: -90px;
  background-color: #fff;

  .section-header {
    margin-top: 3rem;
    font-size: 20px;
    font-weight: 600;
  }

  .embed-responsive {
    position: relative;

    &::before {
      display: block;
      padding-top: 56.25%;
      content: "";
    }

    .embed-responsive-item {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 100%;
      border: 0;
    }
  }

  .grid {
    margin-bottom: 20px;

    .col {
      border: 1px solid $lightgrey;

      .icon {
        display: flex;
        min-height: 140px;
        align-items: center;
        justify-content: center;
      }

      .content {
        padding: 0 20px 20px;

        &.plugins {
          padding-top: 20px;

          img {
            display: block;
            margin: 0 auto 5px;
          }
        }

        h3 {
          margin-top: 0;
          text-align: center;

          a {
            font-size: 20px;
          }
        }

        ul {
          padding-left: 20px;

          li {
            margin-bottom: 10px;
            color: $darkgrey;
            line-height: 1.6em;
            list-style-image: url(/img/arrow.svg);
          }
        }
      }
    }
  }
}

.docs {
  display: flex;
  padding: 30px 30px 50px;
  margin-top: -90px;
  background-color: #fff;

  .side-nav {
    position: relative;
    overflow: overlay;
    width: 20%;
    float: left;
    overflow-wrap: break-word;

    .heading {
      font-size: 18px;
    }

    ul {
      li {
        display: list-item;

        ul {
          padding-left: 0;

          li {
            margin-bottom: 15px;

            a {
              color: $darkgrey;
              font-size: 14px;

              &.active {
                color: $indigo;
              }
            }

            &.heading {
              color: $black;
              font-size: 14px;
            }

            ul {
              li {
                a {
                  padding-left: 1.5em;
                  font-size: 13px;
                }
              }
            }
          }
        }
      }
    }

    .dropdown {
      margin-bottom: 10px;
      font-family: $metropolis-medium;
      font-size: 14px;

      button {
        display: inline;
        padding: 10px 30px 10px 10px;
        border: 1px solid $indigo;
        border-radius: 5px;
        margin-bottom: 10px;
        background-image: url(/img/down-arrow.svg);
        background-position: 90% center;
        background-repeat: no-repeat;
        color: $black;
        cursor: pointer;
        font-family: $metropolis-medium;
        font-size: 14px;

        &:focus {
          background-color: $lightgrey;
        }
      }
    }

    .dropdown-menu {
      position: absolute;
      top: 35px;
      left: 0;
      display: none;
      min-width: 100px;
      padding: 10px 0;
      border: 1px solid $grey;
      border-radius: 5px;
      background-color: $white;

      a {
        display: block;
        padding: 7px 20px;

        &:hover {
          background-color: $lightgrey;
        }
      }

      &.dropdown-menu-visible {
        z-index: 1;
        display: block;
      }
    }

    .form-control {
      display: block;
      width: 100%;
      height: 40px;
      padding: 0.375rem 0.75rem;
      border: 1px solid $lightgrey;
      border-radius: 5px;
      background-color: #fff;
      background-image: url(/img/search-icon.svg);
      background-position: 95% center;
      background-repeat: no-repeat;
      color: $darkgrey;
      font-size: 1.125rem;
      line-height: 1.5;

      &:focus {
        outline: none;
      }

      &::-webkit-search-cancel-button {
        appearance: none;
      }
    }

    .ds-dataset-1 {
      padding: 15px 15px 0;

      a {
        display: inline-block;
        margin-bottom: 10px;
        color: $darkgrey;
        font-family: $metropolis-light;

        div {
          display: inline;
        }
      }

      .algolia-docsearch-suggestion--subcategory-inline {
        &::after {
          content: " /";
        }
      }

      .algolia-docsearch-suggestion--highlight {
        background-color: rgba($ocean, 0.1);
        color: $indigo;
      }

      .algolia-docsearch-suggestion--title {
        font-family: $metropolis-medium;
      }

      .algolia-docsearch-suggestion--category-header,
      .algolia-docsearch-suggestion--subcategory-column {
        display: none;
      }

      .algolia-docsearch-footer {
        font-size: 14px;
        text-align: right;

        a {
          font-size: 14px;
        }
      }
    }

    .ds-dropdown-menu {
      width: 130%;
      border: 1px solid $lightgrey;
      border-radius: 5px;
      background-color: #fff;
    }
  }

  .docs-content {
    width: 75%;
    float: right;

    &.full {
      width: 100%;
    }

    a {
      font-size: 16px;
    }

    ul {
      padding-left: 20px;
      list-style-type: disc;

      li {
        display: list-item;
        margin-bottom: 10px;
        color: $darkgrey;
        font-size: 16px;
        line-height: 1.6em;
        list-style-image: url(/img/arrow.svg);
        list-style-type: unset;

        &:first-child {
          margin-top: 10px;
        }
      }
    }

    ol {
      li {
        display: list-item;
        margin-bottom: 10px;
        color: $darkgrey;
        font-size: 16px;
        list-style-type: decimal;

        &:first-child {
          margin-top: 10px;
        }
      }
    }

    code {
      padding: 2px 8px;
      border: 2px solid $lightgrey;
      color: $darkgrey;
    }

    pre {
      white-space: pre-wrap;

      code {
        display: block;
        padding: 15px;
        border: 15px solid $lightgrey;
        margin-bottom: 30px;
        overflow-x: auto;
      }
    }

    img {
      max-width: 100%;
    }

    @include breakpoint(large) {
      width: 58%;
      padding-right: 20px;
    }

    @include breakpoint(extra-large) {
      width: 75%;
      padding-right: 20px;
    }
  }

  .right-nav {
    width: 15%;
    margin: -30px -30px 0 0;
    float: right;

    .right-nav-content {
      position: sticky;
      top: 0;
      padding: 30px 30px 30px 20px;
      background-color: $lightgrey;
    }

    .buttons {
      margin-top: 0;

      li {
        display: inline-block;
        padding: 8px 0;
        margin-bottom: 0;

        a {
          font-size: 14px;
          text-transform: uppercase;

          img {
            width: 22px;
            vertical-align: middle;
          }
        }
      }
    }

    h4 {
      font-size: 16px;
    }

    ul {
      padding-left: 0;
      margin-bottom: 0;

      li {
        display: block;
        padding-right: 0;
        margin-bottom: 7px;

        a {
          font-family: $metropolis-light;
          font-size: 14px;
        }

        ul {
          margin-top: 7px;
          padding-inline-start: 14px;
        }
      }
    }

    .sticky {
      position: fixed;
      top: 0;
    }

    @include breakpoint(small) {
      display: none;
    }
  }
}

.right-nav-small {
  .right-nav-content {
    width: fit-content;
    padding: 0.5em;
    margin-top: 2.5em;
    background-color: white;
  }

  .buttons {
    margin-top: 0;

    li {
      display: inline-block;
      padding: 8px 0;
      margin-bottom: 0;

      &:hover {
        background-color: $lightgrey;
      }

      a {
        font-size: 14px;
        text-transform: uppercase;

        img {
          width: 22px;
          vertical-align: middle;
        }
      }
    }
  }

  h4 {
    font-size: 16px;
  }

  ul {
    padding-left: 0;
    margin-bottom: 0;

    li {
      display: block;
      padding-right: 0;
      margin-bottom: 7px;

      &:hover {
        background-color: $lightgrey;
      }

      a {
        font-family: $metropolis-light;
        font-size: 14px;
      }

      ul {
        margin-top: 7px;
        padding-inline-start: 14px;
      }
    }
  }

  .sticky {
    position: fixed;
    top: 0;
  }

  @include breakpoint(medium) {
    display: none;
  }

  @include breakpoint(large) {
    display: none;
  }

  @include breakpoint(extra-large) {
    display: none;
  }
}

.avatar {
  filter: grayscale(100%);
  transition: filter 0.6s ease-in-out;

  &:hover {
    filter: grayscale(0%);
  }
}

.home-snippet {
  pre {
    white-space: pre-wrap;

    code {
      display: block;
      padding-right: 1em;
      padding-left: 1em;
      border: 7px solid $lightgrey;
    }
  }
}

.resource-icon {
  max-height: 8em;
}

#search {
  width: 80%;

  input::placeholder {
    color: $darkgrey;
  }

  @include breakpoint(small) {
    .aa-DetachedSearchButtonPlaceholder {
      display: none;
    }
  }

  .aa-Form,
  .aa-DetachedSearchButton {
    border-color: $indigo;
  }
}

.logo {
  height: 1.5em;
  filter: grayscale(100%);
  transition: filter 0.6s ease-in-out;

  &:hover {
    filter: grayscale(0%);
  }
}

.logo-big {
  height: 4em;
}
